1. Technical Field
The present invention generally relates to an improved data processing system and in particular to an improved method and system for programming in a graphic user interface. Still more particularly, the present invention relates to a method and system for visually debugging a program in a graphic user interface.
2. Description of the Related Art
The development of application and system software for data processing systems has traditionally been a time consuming task. The field of software engineering has attempted to overcome the limitations of traditional techniques by proposing new, more efficient software development models. Object oriented programming has emerged as a promising technology that will allow rapid development, implementation and customization of objects. Each new object has certain data attributes and processes or methods that operate on that data. Data is said to be "encapsulated" by an object and can only be modified by the object methods are invoked by sending a message to an object identifying the method and supplying any needed arguments.
Object oriented systems have two important properties in addition to encapsulation. "Inheritance" is the ability to derive a new object from an existing object and inherit all properties, including methods and data structure, from the existing object. The new object may have certain unique features which are supplied as overrides or modifications to the existing class. For example, a new subclass needs to specify only the functions and data that distinguish that class from the existing more general class.
The ability to override an existing method description enables polymorphism, the ability to have a single message to an object be processed in different ways depending on the object itself.
Inheritance and polymorphism create a powerful structure for implementing new software systems. The software developer does not have to develop each piece of a system, he or she need only specify the unique features of the system.
The power of object oriented systems is realized through the development of system "frameworks." A framework is a collection of base classes that can be used by a system implementor to create a final systems product. The framework is defined and developed to work together as a system. Conceptually, the framework is much like a set of standard hardware components used by computer hardware builders. Each of the components has certain defined functions and interfaces and the engineer assembles these components according to a particular design to create a unique hardware system.
One object oriented programming system is the System Object Model (SOM). More information on SOM can be found in SOMobjects Developer Toolkit Users Guide, Version 2.0, June 1993, available from International Business Machines Corporations. More information on object oriented systems in general may be found in Booch, Object Oriented Design With Applications, Benjamin/Cummings Publishing Company, Inc. (1991).
Programming Graphic User Interfaces (GUI) has become more and more difficult. New program systems, such as Presentation Manager (PM) available from International Business Machines Corporation or Windows available from Microsoft Corporation have made GUI's easier to use, but more difficult to program. "Windows" is a trademark of Microsoft Corporation. Object oriented programming has made this process easier. Visual builder systems also called "visual programming systems", such as Microsoft's Visual Basic, have made the process easier.
One possible design for a visual builder system employs an object oriented approach in which each element of a user interface, such as a window, a button, or an entry field, is treated as an object. The term "object" refers to an encapsulation of data and services that manipulate that data. Each object supports methods (such as resize), data (such as color), and events (such as button-was-pressed). Programming in such a system is performed by causing an event to execute a method on an object. This type of programming can be performed visually by drawing a line from the source object, which generates the event, to a target object on which a method is executed. A user can then specify which method is to be executed as depicted in FIG. 1. With reference to FIG. 1, a diagram of GUI containing a window in which visual programming may be performed is depicted. With reference to FIG. 1, graphic user interface 2 consists of a window 4 and a button 6. A user may draw a link 8 button 6 to window 4 using a mouse to manipulate pointer 7 and select a method called "Close". In response, selection of button 6 results in window 4 being closed. This type of interface is presented within SmallTalk Parts available from Digitalk, Inc. and VisualAge available from International Business Machines Corporation.
The term "mouse", when used in this document, refers to any type of operating system supported graphical pointing device including, but not limited to: a mouse, trackball, light pen, touch screen, and the like. A pointing device is typically employed by a user of a data processing system to interact with a data processing system's GUI. A "pointer" is an iconic image controlled by a mouse or other such device and is displayed on the video display device of a data processing system to visually indicate to the user icons, menus, or the like that may be selected or manipulated.
The visual programming approach using a visual builder system may be extended by allowing a user to write code in a window, such as window 200 in FIG. 2 and attach it an event, which may be accomplished using action objects. Action objects are objects that include data and a method. The data typically has a "name" portion (the name of the object) and "code" portion (the program that is typed by the user). The method is a trigger that executes the program in code. Action objects may be employed as a target object using the visual linking model described above. If the target object is not a script, a specialized action object, called a "method action object", can be employed. For method action objects, the instance data contains both a pointer to an object (called TargetObject), and the name of the method (called TargetMethod).
As can be seen with reference to FIG. 2, window 200 includes field 202, which is the name of the action object and field 204, which is the field in which the user types code for the action object. Whenever the trigger method is called on an action object, the target method is called on the target object.
Many programmers allow the user to design applications visually, as described above, but force the user to debug such applications using traditional non-visual mechanisms, such as through utilizing break points and single stepping. Such a debugging system is a procedural debugging system and is often employed to debug method implementations in object oriented systems. Therefore, it would be desirable to have a visual programming environment that provides a visual debugging mechanism to the user.